﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Konveyer.Core.Interfaces
{
    /// <summary>
    /// Represents an object used for executing Requests (IRequest)
    /// </summary>
    public interface IRunner
    {
        IRunner With(IRequest request);
        IRunner WhenStarts(Action<IRequest> onRequestStart);
        IRunner WhenEnds(Action<IRequest> onRequestEnd);
        IRunner WhenWidgetStarts(Action<IWidget,IRequest> onWidgetStarts);
        IRunner WhenWidgetEnds(Action<IWidget, IRequest> onWidgetEnds);
        IRunner WhenExceptionIsThrown(Action<IRequest> onException);

        void Execute(IRequest request = null);

        
    }
}
